package com.bwie.controller;

import com.bwie.service.TbUserService;
import com.bwie.utils.R;
import com.bwie.utils.Result;
import com.bwie.vo.LoginInfoVo;
import com.bwie.vo.LoginVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @projectName: server-2211a-red
 * @package: com.bwie.controller
 * @className: IndexController
 * @author: 杨珂
 * @description: TODO
 * @date: 2025/6/6 14:02
 * @version: 1.0
 */
@RestController
@RequestMapping("/user/index")
public class IndexController {

    @Autowired
    TbUserService tbUserService;

    @PostMapping("/sendCode/{mobile}")
    public Result sendCode(@PathVariable("mobile") String mobile) {
        return tbUserService.sendCode(mobile);
    }


    @PostMapping("/login")
    public Result login(@RequestBody @Validated LoginVo loginVo) {
        return tbUserService.login(loginVo);
    }


}
